package com.nextbusmn.server.dataobjects;

import java.util.HashSet;
import java.util.Set;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Key;

// Java Data Object for Bus Route Data
@PersistenceCapable
public class BusRouteData implements NextBusData {
	
	@PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    private Key key;
	
	@Persistent
	private int routeID;
	
	@Persistent
	private String routeLongName;
	
	@Persistent(mappedBy="busRoute")
	private Set<BusTripData> busTripData;
	
	public BusRouteData(int routeID,
						String routeLongName) {
		
		this.setRouteID(routeID);
		this.setRouteLongName(routeLongName);
		this.busTripData = new HashSet<BusTripData>();
	}

	public int getRouteID() {
		return routeID;
	}

	public void setRouteID(int routeID) {
		this.routeID = routeID;
	}

	public String getRouteLongName() {
		return routeLongName;
	}

	public void setRouteLongName(String routeLongName) {
		this.routeLongName = routeLongName;
	}

	public Set<BusTripData> getBusTripData() {
		return busTripData;
	}

	public void addBusTripData(BusTripData busTrip) {
		this.busTripData.add(busTrip);
	}
	
	public void setBusTripData(Set<BusTripData> busTripData) {
		this.busTripData = busTripData;
	}

	public Key getKey() {
		return key;
	}

	public void setKey(Key key) {
		this.key = key;
	}
	
	

}
